class CategoryData < ActiveRecord::Migration
  def self.up
    down
    category_root_1 = Category.create([
        {:name => "化学药"},
        {:name => "消化系统药", :parent_id => 1},
        {:name => "循环系统药", :parent_id => 1},
        {:name => "神经和肌肉、骨骼系统药", :parent_id => 1},
        {:name => "呼吸系统药", :parent_id => 1},
        {:name => "五官科药", :parent_id => 1},
        {:name => "抗菌药与抗病毒药", :parent_id => 1},
        {:name => "抗寄生虫药", :parent_id => 1},
        {:name => "皮肤科药", :parent_id => 1},
        {:name => "有关激素类药", :parent_id => 1},
        {:name => "抗肿瘤药", :parent_id => 1},
        {:name => "泌尿与生殖系统药", :parent_id => 1},
        {:name => "维生素、矿物质与氨基酸", :parent_id => 1},
        {:name => "其他", :parent_id => 1}
      ])
    
    category_root_2 = Category.create([
        {:name => "中成药"},
        {:name => "内科药", :parent_id => 15},
        {:name => "外科药", :parent_id => 15},
        {:name => "儿科药", :parent_id => 15},
        {:name => "五官科药", :parent_id => 15},
        {:name => "骨伤科药", :parent_id => 15},
        {:name => "妇科药", :parent_id => 15},
        {:name => "皮肤科药", :parent_id => 15},
        {:name => "肿瘤科药", :parent_id => 15},
        {:name => "其他", :parent_id => 15}
      ])
    
      category_root_3 = Category.create([
          {:name => "中药材和饮片"}
      ])
      category_root_4 = Category.create([
          {:name => "化学原料药和中间体"}
      ])
      category_root_5 = Category.create([
          {:name => "生物制品"}
      ])
      category_root_6 = Category.create([
          {:name => "兽药"}
      ])
      category_root_7 = Category.create([
          {:name => "其他药品"}          
      ])
    
     category_root_8 = Category.create([
        {:name => "医疗器械"},
        {:name => "护理设备", :parent_id => 30},
        {:name => "药液输送保存器械", :parent_id => 30},
        {:name => "能量治疗器械", :parent_id => 30},
        {:name => "医用敷料", :parent_id => 30},
        {:name => "清洁消毒器械", :parent_id => 30},
        {:name => "诊断监护仪器", :parent_id => 30},
        {:name => "外科器械", :parent_id => 30},
        {:name => "避孕器械", :parent_id => 30},
        {:name => "植入器械", :parent_id => 30},
        {:name => "其他器械", :parent_id => 30}
      ])  

     category_root_9 = Category.create([
        {:name => "保健食品"},
        {:name => "免疫调节", :parent_id => 41},
        {:name => "延缓衰老", :parent_id => 41},
        {:name => "营养强化", :parent_id => 41},
        {:name => "减肥", :parent_id => 41},
        {:name => "改善性功能", :parent_id => 41},
        {:name => "改善记忆", :parent_id => 41},
        {:name => "调节血脂", :parent_id => 41},
        {:name => "促进生长发育", :parent_id => 41},
        {:name => "抗疲劳", :parent_id => 41},
        {:name => "美容", :parent_id => 41}
      ])

     category_root_10 = Category.create([
        {:name => "仪器设备"},
        {:name => "分析和检测仪器", :parent_id => 52},
        {:name => "粉碎机械", :parent_id => 52},
        {:name => "包装设备", :parent_id => 52},
        {:name => "用水设备", :parent_id => 52},
        {:name => "原料药生产设备", :parent_id => 52},
        {:name => "制剂机械", :parent_id => 52},
        {:name => "饮片机械", :parent_id => 52},
        {:name => "其他", :parent_id => 52}
      ])  
  end

  def self.down
    Category.delete_all
  end
end
